package com.aiyige.page.publish.selectprice;

import android.view.View;
import android.widget.TextView;

import com.aiyige.R;
import com.aiyige.page.publish.selectprice.model.PriceGroup;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.LinkedList;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by zhuyakun on 2018/4/8.
 */
public class PriceGroupAdapter extends BaseQuickAdapter<PriceGroup, PriceGroupAdapter.ViewHolder> {

    public PriceGroupAdapter() {
        super(R.layout.price_group, new LinkedList<PriceGroup>());
    }

    @Override
    protected void convert(ViewHolder helper, PriceGroup item) {
        helper.bindData(item);
    }


    public class ViewHolder extends BaseViewHolder {
        @BindView(R.id.titleTv)
        TextView titleTv;

        public ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }

        public void bindData(PriceGroup item) {
            titleTv.setText(item.getTitle());
            titleTv.setSelected(item.isSelected());
        }
    }
}
